package com.cqc.recyclyviewitemanimation01.activity;

import android.content.Context;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.AppCompatSpinner;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.cqc.recyclyviewitemanimation01.adapter.RecyclerViewListAdapter;
import com.cqc.recyclyviewitemanimation01.R;

public class RecyclerViewLayoutAnimationActivity extends AppCompatActivity {

    private Context context = this;
    private RecyclerView recyclerView;
    private AppCompatSpinner spinner;
    private String[] array = {"从上往下", "从右往左", "从下往上"};
    private RecyclerViewListAdapter adapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_recycler_view_layout_animation);


        recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
        recyclerView.setHasFixedSize(true);
        recyclerView.setLayoutManager(new LinearLayoutManager(context));
        recyclerView.setItemAnimator(new DefaultItemAnimator());
        //        LayoutAnimationController loadLayoutAnimation = AnimationUtils.loadLayoutAnimation(context, R.anim.layout_animation_slide_in_right);
        //        recyclerView.setLayoutAnimation(loadLayoutAnimation);
        adapter = new RecyclerViewListAdapter();
        recyclerView.setAdapter(adapter);

    }
}
